<html xmlns="http://www.w3.org/1999/xhtml"  
      xmlns:h="http://java.sun.com/jsf/html"  
      xmlns:f="http://java.sun.com/jsf/core"  
      xmlns:p="http://primefaces.org/ui"
      xmlns:ui="http://java.sun.com/jsf/facelets"> 

    <ui:composition template="../index.xhtml">
        <ui:define name="conteudo">
            <h:form>
                <p:messages/>
                <p:dataTable id="listContasPagar" var="nota" value="#{relatorioNfeEntrada.listNfe_entrada_cabecalho}" widgetVar="carsTableAtivos" 
                             rowKey="#{nota.id}" selectionMode="single"  emptyMessage="Nenhum registro foi encontrado!" paginator="true" rows="10" rowsPerPageTemplate="5,10,15,#{relatorioNfeEntrada.listNfe_entrada_cabecalho.size()}">
                    <f:facet name="header" >  
                        <p:outputPanel>  
                            <h:outputText value="Digite para pesquisar " />
                            <p:inputText id="globalFilter" onkeyup="carsTableAtivos.filter()" style="width:150px" /> 
                        </p:outputPanel>  
                    </f:facet>  
                    <p:column headerText="Ações" footerText="Ações" filterMatchMode="Ações" style="width: 30px;">  
                        <p:commandButton value="Excluir" action="#{nfeEntradaControler.setNfe_entrada_cabecalho(nota)}" onclick="confirmationExcluirNFE.show();"/>
<!--                        <p:commandButton value="Editar" action="#{nfeEntradaControler.alterar(nota.id)}" ajax="false"/>-->
                    </p:column>
                    <p:column filterBy="${nota.data_entrada}" headerText="Data entrada" sortBy="${forn.data_entrada}">    
                        <h:outputText value="${nota.data_entrada}">
                            <f:convertDateTime /> 
                        </h:outputText>  
                    </p:column>  
                    <p:column filterBy="${nota.valorTotalNfe}" headerText="Valor nota" sortBy="${forn.valorTotalNfe}">    
                        <h:outputText value="${nota.valorTotalNfe}">
                            <f:convertNumber type="currency"  currencySymbol='R$'/> 
                        </h:outputText>  
                    </p:column>  
                    <p:column filterBy="${nota.numeroNfe}" headerText="Número nota" sortBy="${forn.numeroNfe}">    
                        <h:outputText value="${nota.numeroNfe}"/>  
                    </p:column>  
                    <p:column filterBy="${nota.chaveAcesso}" headerText="Chave de acesso" sortBy="${forn.chaveAcesso}">    
                        <h:outputText value="${nota.chaveAcesso}"/>  
                    </p:column> 
                </p:dataTable>
                <p:confirmDialog id="confirmDialog" message="Confirma exclusão da nota?" appendToBody="true"
                                 header="Atenção!!!" severity="alert" widgetVar="confirmationExcluirNFE" >  
                    <p:commandButton id="confirm" value="Sim" oncomplete="confirmationExcluirNFE.hide()"  
                                     actionListener="#{nfeEntradaControler.excluirNota()}" update="@form" onclick="statusDialog.show();" onsuccess="statusDialog.hide();"/>  
                    <p:commandButton id="decline" value="Cancelar" onclick="confirmationExcluirNFE.hide()" type="button" />   
                </p:confirmDialog>
            </h:form>
        </ui:define>
    </ui:composition>
</html>